package com.xiaoming.project.core;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class StreamTest {

    static void whenEmptyAnyMatchshouldReturnFalse() {
        String xiaoming = "xiaoming";
        List<String> testList = Arrays.asList(xiaoming);
        boolean result = testList.stream().anyMatch(str -> str.equals(xiaoming));
        System.out.println(result);

        List<String> emptyList = Collections.emptyList();
        result = emptyList.stream().anyMatch(str -> str.equals(xiaoming));
        System.out.println(result);
    }

}